<% layout('/layouts/default.html', {title: '社群管理管理', libs: ['validate','fileupload']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header with-border">
			<div class="box-title">
				<i class="fa icon-note"></i> ${text(ttopicOfConversation.isNewRecord ? '新增社群管理' : '编辑社群管理')}
			</div>
			<div class="box-tools pull-right">
				<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i></button>
			</div>
		</div>
		<#form:form id="inputForm" model="${ttopicOfConversation}" action="${ctx}/zx/topic/conversation/ttopicOfConversation/save" method="post" class="form-horizontal">
			<div class="box-body">
				<div class="form-unit">${text('基本信息')}</div>
				<#form:hidden path="id"/>
				<div class="row">
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required">*</span> ${text('主题')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">
								<#form:input path="topicTitle" maxlength="100" class="form-control required"/>
							</div>
						</div>
					</div>	
					<div class="col-xs-6">
						<div class="form-group">
							<label class="control-label col-sm-4" title="">
								<span class="required hide">*</span> ${text('类型')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-8">							
							    <#form:radio path="hotOrRecomm" dictType="t_hot_or_recomm" blankOption="true" class="form-control" />							
							</div>
						</div>
					</div>				
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2"><span class="required">*</span>${text('话题分类')}：</label>
							<div class="col-sm-10">
							    <#form:checkbox path="itemize" dictType="t_topic_conversation"  class="form-control required"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2"><span class="required">*</span>${text('主题封面')}：</label>
							<div class="col-sm-10">							
								<#form:fileupload path="topicImg" 
								id="topicImg" 
								returnPath="true"
								filePathInputId="topicImg"
								maxUploadNum="1"
                                imageMaxWidth='-1'
								imageMaxHeight='-1'
								uploadType="image" class="required" readonly="false"/>
								<#form:input path="topicImg" name="topicImg" class="form-control required hide"/>
							</div>
						</div>
					</div>
				</div>
				
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">${text('添加主题的图片')}：</label>
							<div class="col-sm-10">							
								<#form:fileupload path="topicImgPath" 
								id="topicImgPath" 
								returnPath="true"
								filePathInputId="topicImgPath"
								maxUploadNum="5"
                                imageMaxWidth='-1'
								imageMaxHeight='-1'
								uploadType="image" class="" readonly="false"/>
								<#form:input path="topicImgPath" name="topicImgPath" class="form-control hide"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('话题的简介')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="topicSimple" rows="4" maxlength="200" class="form-control"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('话题的内容')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="topicContent" rows="4" maxlength="200" class="form-control"/>
							</div>
						</div>
					</div>
				</div>			
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2" title="">
								<span class="required hide">*</span> ${text('备注')}：<i class="fa icon-question hide"></i></label>
							<div class="col-sm-10">
								<#form:textarea path="remarks" rows="4" maxlength="200" class="form-control"/>
							</div>
						</div>
					</div>
				</div>			
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">${text('图片上传')}：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadImage" bizKey="${ttopicOfConversation.id}" bizType="ttopicOfConversation_image"
									uploadType="image" class="" readonly="false"/>
							</div>
						</div>
					</div>
				</div>
				<div class="row">
					<div class="col-xs-12">
						<div class="form-group">
							<label class="control-label col-sm-2">${text('附件上传')}：</label>
							<div class="col-sm-10">
								<#form:fileupload id="uploadFile" bizKey="${ttopicOfConversation.id}" bizType="ttopicOfConversation_file"
									uploadType="all" class="" readonly="false"/>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div class="box-footer">
				<div class="row">
					<div class="col-sm-offset-2 col-sm-10">
						<% if (hasPermi('zx:topic:conversation:ttopicOfConversation:edit')){ %>
							<button type="submit" class="btn btn-sm btn-primary" id="btnSubmit"><i class="fa fa-check"></i> ${text('保 存')}</button>&nbsp;
						<% } %>
						<button type="button" class="btn btn-sm btn-default" id="btnCancel" onclick="js.closeCurrentTabPage()"><i class="fa fa-reply-all"></i> ${text('关 闭')}</button>
					</div>
				</div>
			</div>
		</#form:form>
	</div>
</div>
<% } %>
<script>
$("#inputForm").validate({
	submitHandler: function(form){
		js.ajaxSubmitForm($(form), function(data){
			js.showMessage(data.message);
			if(data.result == Global.TRUE){
				js.closeCurrentTabPage(function(contentWindow){
					contentWindow.page();
				});
			}
		}, "json");
    }
});
</script>